'use strict';
const Router = require('koa-router');
const check = require('./middleware/check');
const transformer = require('./middleware/transformer');
const authenticator = require('./middleware/authenticator');

const log = require('./controller/log');

const router = new Router({ prefix: '/api/v1' });

router.use('/', authenticator.tokenRequired);

router.post('/saveReq', check.checkReq, transformer.transformReq, log.saveReq);
router.post('/saveRes', log.saveRes);

module.exports = router;
